Skip to content

Conversation

priteau
Copy link
Member

@priteau priteau commented Jun 23, 2025

No description provided.

@priteau priteau self-assigned this Jun 23, 2025
@priteau priteau requested a review from a team as a code owner June 23, 2025 16:34
@priteau priteau force-pushed the lets-encrypt-ood branch from c346577 to 2136629 Compare June 26, 2025 15:27
@priteau priteau force-pushed the lets-encrypt-ood branch 4 times, most recently from a85f8da to ffeafae Compare July 9, 2025 15:03
@priteau priteau force-pushed the lets-encrypt-ood branch from ffeafae to ccafe06 Compare July 11, 2025 07:52

Alternatively, you can generate a certificate from Let's Encrypt automatically by configuring the following variables:
- `openondemand_certbot`: Optional. Default is false. Set to true to request a certificate from Let's Encrypt.
- `openondemand_certbot_email`: Optional. Default is empty. Set to the admin email address if using Let's Encrypt.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the domain for this have to match e.g. the cluster_domain_suffix or anything?

Copy link
Collaborator

@sjpb sjpb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few refactoring comments. Want to work out a way merging this doens't force everyone to add HTTP secgroup too though - maybe it is just docs in the role?

default = [
"default", # allow all in-cluster services
"SSH", # access via ssh
"HTTP", # HTTP-01 challenge and redirect to HTTPS
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like the fact this means all existing deployments, when they merge this, are either going to have to add this HTTP secgroup or else override login_security_groups (or equivalent for the nodegroup containing ondemand host). I wonder if we can work around this somehow...

import_role:
name: openondemand
tasks_from: certbot.yml
when: "'openondemand' in group_names"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also add when: openondemand_certbot | bool for consistency with behaviour of openondemand/tasks/main.yml?


- name: Generate Let's Encrypt certificate
command: sudo certbot certonly --standalone -d {{ openondemand_servername }} -n -m {{ openondemand_certbot_email }} --agree-tos
when: appliances_mode == 'configure'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd be more consistent as:

Suggested change
when: appliances_mode == 'configure'
when: appliances_mode != 'build'

b/c you can use e.g. -e appliances_mode=all to fake a build + deploy for debugging/dev - generally we've tried to make it so that not using "build" or "configure" does "everything".

But its definitely not totally consistent so not very fussed.

- `openondemand_ssl_cert_key`: Optional. Default `/etc/pki/tls/private/localhost.key` (unless `openondemand_certbot` is true).

Alternatively, you can generate a certificate from Let's Encrypt automatically by configuring the following variables:
- `openondemand_certbot`: Optional. Default is false. Set to true to request a certificate from Let's Encrypt.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree this is the correct default, but wonder if we should set it true in stackhpc so
a) we include these packages in the StackHPC images
b) CI tests certbot

- Created instances have access to internet (note proxies can be setup through the appliance if necessary).
- Created instances have accurate/synchronised time (for VM instances this is usually provided by the hypervisor; if not or for bare metal instances it may be necessary to configure a time service via the appliance).
- Three security groups are present: `default` allowing intra-cluster communication, `SSH` allowing external access via SSH and `HTTPS` allowing access for Open OnDemand.
- Four security groups are present: ``default`` allowing intra-cluster communication, ``SSH`` allowing external access via SSH, and ``HTTP`` and ``HTTPS`` allowing access for Open OnDemand.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

- python3-certbot-apache

- block:
- name: Validate that server name is set
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually already done in ansible/roles/openondemand/tasks/validate.yml?

- certbot
- python3-certbot-apache

- block:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we move these to ansible/roles/openondemand/tasks/validate.yml? That is called much earlier (buy ansible/validate) than this, and only from site.yml so doesn't run during build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants